package org.qinys.mongodb.demo;

import org.qinys.mongodb.dao.WeiboDao;
import org.qinys.mongodb.dao.impl.WeiboDaoImpl;
import org.qinys.mongodb.model.WeiboInfo;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:META-INF/spring/mongodb.xml");
		WeiboDao weiboDao = context.getBean(WeiboDaoImpl.class);
		weiboDao._test();
		WeiboInfo weiboInfo = new WeiboInfo();
		weiboInfo.setWeiboId("2351720153");
		weiboInfo.setNickName("veesonsan");
		weiboInfo.setSex("男");
		weiboInfo.setBirthday("2015-08-17");
		weiboInfo.setSchool("四川大学");
		weiboDao.insert(weiboInfo);
		System.err.println(weiboDao.findOneByWeiboId("2351720153").toString());
//		weiboDao._test();
//		weiboDao.delete(weiboInfo);
	}
}
